<template>
	<view class="container">
		<view style="width: 100%;height: 20rpx;"></view>
		<view class="list_view">
			<view class="item_view">
				<view class="left_view">
					门禁名称
				</view>
				<view class="right_view">
					{{ dataModel.deviceName }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					车站
				</view>
				<view class="right_view">
					{{ dataModel.tenantName }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					区域
				</view>
				<view class="right_view">
					{{ dataModel.area }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					安装位置
				</view>
				<view class="right_view">
					{{ dataModel.location }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					状态
				</view>
				<view class="right_view">
					{{ deviceStatusEnum(dataModel.status) }}
				</view>
			</view>

			<view class="item_view">
				<view class="left_view">
					事件类型
				</view>
				<view class="right_view">
					报警事件
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					事件时间
				</view>
				<view class="right_view">
					{{ dataModel.eventTime }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					事件级别
				</view>
				<view class="right_view">
					{{ eventGradeEnum(dataModel.eventGrade) }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					事件描述
				</view>
				<view class="right_view">
					{{ dataModel.msgContent }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				id: '',
				dataModel: {}
			}
		},
		onLoad() {
			this.id = this.$Route.query.id
			this.getNoticeDetailData()
		},
		methods: {
			deviceStatusEnum(e) {
				switch (e) {
					case 1:
						return '在线'
					case 2:
						return '离线'
					default:
						break
				}
			},
			eventGradeEnum(e) {
				switch (e) {
					case 1:
						return '普通'
					case 2:
						return '紧急'
					default:
						break
				}
			},
			// eventGradeEnum(e) {
			// 	switch (e) {
			// 		case 1:
			// 			return '门禁事件'
			// 		case 2:
			// 			return '智能锁事件'
			// 		case 3:
			// 			return '报警事件'
			// 		default:
			// 			break
			// 	}
			// },
			getNoticeDetailData() {
				var that = this
				this.$apis.getNoticeDetail(this.id).then(result => {
					if (result.res.data.code == '200') {
						that.dataModel = result.res.data.data
					} else {
						this.$show.toastMessage(result.res.data.msg);
					}
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #F8F8F8;
	}

	.list_view {
		border-top: 1rpx solid #E8E8E8;

		.item_view {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 24rpx;
			border-bottom: 1rpx solid #E8E8E8;
			background-color: #FFFFFF;

			.left_view {
				display: flex;
				flex-direction: row;

				.content_view {
					margin-left: 20rpx;
				}
			}
		}
	}
</style>